<!--sidebar-menu-->
<div id="sidebar" class="clearfix"><!-- <a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard</a> -->
  <ul style="display: block;">
  {% include "common/menu.html" %}
  </ul>
</div>
<!--end sidebar-menu-->

<div id="content">

    <div class="container-fluid" style="padding: 0;">

      <div class="widget-box tab-tabs" >
          <div class="widget-title">
              <ul class="nav nav-tabs">
                  {% include "common/tab.html" %}
              </ul>
          </div>
          <div class="widget-content tab-content">
            <div id="tab1" class="tab-pane active">
              <div class="container-fluid">
                  <div class="row-fluid" style="margin: 20px 0;overflow: hidden;">
                   </div>
                  <div class="row-fluid">
                    <div class="content-box content-box-padding" >
                      <p style="font-size:20px;">给用户发放VIP:</p>
                      <form action='' method='post'>
                          <span style="width:80px;display:inline-block;text-align:right;font-size:14px;">用户uid：</span><input type="text" id ="uid" style="font-size:14px;">
                          <br/><span style="width:80px;display:inline-block;text-align:right;font-size:14px;">类型：</span>
                          <select id="vipId" style="width: 100px;">
                              {% for vip in vips %}
                              <option value="{{ vip['id'] }}">{{ vip['name'] }}</option>
                              {% endfor %}
                          </select>
                          <br/><span style="width:80px;display:inline-block;text-align:right;font-size:14px;">天数：</span><input style="font-size:14px;" type="text" id="day" value="10">
                          <input type='hidden' name='act' value='1'><br/><br/>
                         <button type="button" class="" style="" onclick="sendVipSubmit()">确定</button>
                      </form>
                    </div>
                  </div>
                </div>
            </div>

         </div>
        </div>

    </div>


</div>

<script type="text/javascript">
function sendVipSubmit(){
  var data={};
  data.uid = $('#uid').val();
  data.vipId = $('#vipId').val();
  data.day = $('#day').val();
  if(parseInt(data.day) > 100){
    alert('最多一次发放100天VIP');
    return;
  }
  $.ajax({
    type:"POST",
    data:data,
    url:'',
    dataType:'json',
    success:function(res){
      if(res.code == 0) {
        alert('操作成功');
        location.reload();
      }else{
        alert(res.info);
      }
    }
  });
}
</script>